package com.ruoyi.common.core.domain.entity;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.ruoyi.common.core.domain.BaseEntity;
import com.ruoyi.common.xss.Xss;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import java.util.Date;

/**
 * 会员车辆绑定实体类
 *
 * @author ruoyi
 */
public class MemberCar extends BaseEntity {

    private static final long serialVersionUID = 1L;

    /** 主键ID */
    private Long id;

    /** 会员手机号 */
    @NotBlank(message = "会员手机号不能为空")
    @Size(min = 0, max = 20, message = "会员手机号长度不能超过20个字符")
    private String memberPhone;

    public String getOpenid() {
        return openid;
    }

    public void setOpenid(String openid) {
        this.openid = openid;
    }

    /** 会员openid */
//    @NotBlank(message = "会员手机号不能为空")
    private String openid;

    /** 车牌号码 */
    @Xss(message = "车牌号码不能包含脚本字符")
    @NotBlank(message = "车牌号码不能为空")
    @Size(min = 0, max = 20, message = "车牌号码长度不能超过20个字符")
    private String carNum;

    /** 车牌状态（1=绑定中，2=禁用中，3=已解绑） */
    @NotNull(message = "车牌状态不能为空")
    private Integer carStatus;

    /** 绑定时间 */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date bindTime;

    /** 创建人 */
    @Size(min = 0, max = 64, message = "创建人长度不能超过64个字符")
    private String createBy;

    /** 创建时间 */
    private Date createTime;

    /** 更新人 */
    @Size(min = 0, max = 64, message = "更新人长度不能超过64个字符")
    private String updateBy;

    /** 删除标志（0=正常，1=已删除） */
    private Integer deleted;

    public MemberCar() {}

    public MemberCar(Long id) {
        this.id = id;
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getMemberPhone() {
        return memberPhone;
    }

    public void setMemberPhone(String memberPhone) {
        this.memberPhone = memberPhone;
    }

    public String getCarNum() {
        return carNum;
    }

    public void setCarNum(String carNum) {
        this.carNum = carNum;
    }

    public Integer getCarStatus() {
        return carStatus;
    }

    public void setCarStatus(Integer carStatus) {
        this.carStatus = carStatus;
    }

    public Date getBindTime() {
        return bindTime;
    }

    public void setBindTime(Date bindTime) {
        this.bindTime = bindTime;
    }


    public Integer getDeleted() {
        return deleted;
    }

    public void setDeleted(Integer deleted) {
        this.deleted = deleted;
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
                .append("id", getId())
                .append("memberPhone", getMemberPhone())
                .append("openid", getOpenid())
                .append("carNum", getCarNum())
                .append("carStatus", getCarStatus())
                .append("bindTime", getBindTime())
                .append("createBy", getCreateBy())
                .append("createTime", getCreateTime())
                .append("updateBy", getUpdateBy())
                .append("updateTime", getUpdateTime())
                .append("deleted", getDeleted())
                .toString();
    }
}
